<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no" name="format-detection">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1;user-scalable=no;">
    <title>用户登录</title>
    <link rel="stylesheet" href="/statics/view/css/bootstrap.css">
    <link rel="stylesheet" href="/statics/view/css/style.css">
    <link rel="stylesheet" href="/statics/view/css/member.css">
    <link rel="stylesheet" href="/statics/view/css/order3.css">
    <script charset="utf-8" src="/statics/view/js/jquery.min.js"></script>
    <script type="text/javascript" src="/statics/view/js/common.js"></script>
    <script type="text/javascript" src="/statics/view/js/jquery.validate.js"></script>
    <script type="text/javascript" src="/statics/layer.m/layer.m.js"></script>
    <script type="text/javascript">
        $().ready(function() {
            var $loginForm = $("#loginForm");
            var $username = $("#username");
            var $password = $("#password");
            //var $smsCode = $("#smsCode");

            // 表单验证
            $loginForm.validate({
                rules: {
                    username: "required",
                    password: "required"
                    // smsCode: "required"
                },
                submitHandler: function(form) {
                    layer.open({
                        type: 2,
                        content: '登陆中~'
                    });
                    if($("#user-login").hasClass("disabled")){
                        return false;
                    }
                    $("#user-login").addClass("disabled");
                    $.ajax({
                        url: $loginForm.attr("action"),
                        type: "POST",
                        data: {
                            username: $username.val(),
                            password: $password.val(),
                            // smsCode : $smsCode.val()
                        },
                        dataType: "json",
                        cache: false,
                        success: function(message) {
                            layer.closeAll();
                            $("#user-login").removeClass("disabled");
                            if (message.type == "success") {
                            [#if redirectUrl??]
                                location.href = "${redirectUrl}";
                            [#else]
                                location.href = "/";
                            [/#if]
                            } else {
                                layer.open({
                                    content: message.content,
                                    time: 2
                                });
                            }
                        },error:function(){
                            $("#user-login").removeClass("disabled");
                            layer.closeAll();
                            layer.open({
                                content: "服务器异常",
                                time: 2
                            });
                        }
                    });
                }
            });
        });
    </script>
</head>
<body class="" style="background-color:#fff">
<header class="header">
    <div class="fix_nav">
        <div style="max-width:768px;margin:0 auto;background:#db3652;position: relative;">
            <a class="nav-left back-icon" href="javascript:history.back();">返回</a>
            <div class="tit" style="font-size:18px;">用户登陆</div>
            <a class="nav-right icon-home" href="/dbs/index.html">首页</a>
        </div>
    </div>
</header>
<div class="maincontainer">
    <div class="container itemdetail mini-innner">
        <div class="row"  id="panel-forms-login">
            <div class="col-md-12 tal mt20" data-validform="loginForm">
                <form  id="loginForm"  class="form-signin"  action="/login_validate" method="POST" >
                    <input type="hidden" id="returnUrl" name="returnUrl" value="http://m.legendshop.cn/p/orderDetails"/>

                    <input name="username"   id="username" type="text" style="margin-bottom: -2px;-webkit-appearance:none; " class="form-control" placeholder="手机号码" message="帐号" required="true" autofocus=""  tabindex="1" >
                    <br>
                    <input id="password" name="password" type="password" class="form-control" placeholder="请输入密码" message="密码" required="true" style="-webkit-appearance:none;" autocomplete="off"  tabindex="2" >
                    <label class="checkbox">

                        <a href="/forget" style="float:right">忘记密码</a>
                    </label>
                    <div class="clear"></div>
                    <div class="col-xs-6 p0"><button type="submit" class="btn btn-info btn-block"  data-action="loginCheck" id="user-login"  tabindex="5" >登  陆</button></div>
                    <div class="col-xs-5 p0" style="margin-left:10px;"><button type="button" class="btn btn-default btn-block" id="user-register" onclick="window.location.href='/reg'"  tabindex="6" >注 册</button></div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var contextPath = '';
</script>
</body>
</html>